const app = getApp()
Component({
  data: {
    mobile:'',
    name: ''
  },
  methods:{
    upPassword(){
      wx.navigateTo({
        url: './password/index',
      })       
    },
    logout(){
      wx.redirectTo({
        url: '/pages/login/login',
      })
    },
    getLoginUserInfo(){
      app.func.request({
        url: '/oauth/info',
        method: 'get',
        success:({code,data,msg})=>{
          const {mobile,name}  = data
          this.setData({
            mobile,name
          })
        }
      })
    }
  },
  pageLifetimes: {
    show() {
      this.getLoginUserInfo()
      if (typeof this.getTabBar === 'function' &&
        this.getTabBar()) {
        this.getTabBar().setData({
          value: 'user'
        })
      }
    }
  }
});
